<script>
	Ext.onReady(function(){
		$("#btn_add").click(function(){
			var comment = $('#txt_name').val().trim();
			var link = $('#txt_link').val().trim();
			if(link == ""){
				alert("Chưa nhập đường dẫn!");
			}
			Ext.Ajax.request({
				url:  'services/add_link.php',
				method: 'POST',
				params: {
							comment: comment,
							link: link
						},
				success: function ( result, request ) {	
					if (result.responseText == 1){
						alert('Nhập thành công');
						window.close();
					}
				},
				failure: function ( result, request ) {
				}
			});
		})
	});
</script>

	<table id="tb-device-info-create" width="100%" class="table-form" cellspacing="0">
		 <tr>
			<td class="label"  style="width:30%;">Name</td>
	    	<td class="control">
	        	<input type='text' id='txt_name' name='txt_name' style='width:300px' />
			</td>
		</tr>
	  	<tr>
			<td class="label"  style="width:30%;">Link</td>
	    	<td class="control">
	        	<input type='text' id='txt_link' name='txt_link' style='width:300px' />
				(Ex: http://www.wheelhouse.cafe.net)
			</td>
		</tr>
		<tr>
			<td colspan ='2' align'center'>
				<input type='button' value ='Add' id='btn_add' name='btn_add' />
			</td>
		</tr>
	</table>